import 'package:flutter/material.dart';
import './myFonts.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('图标，图标组件'),
          backgroundColor: Colors.pink[300],
        ),
        body: MyHomePage(),
      ),
    );
  }
}

//内置图标
class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: const [
        SizedBox(height: 20),
        Text('内置图标'),
        Icon(Icons.home, size: 40, color: Colors.pink),
        SizedBox(height: 20),
        Icon(
          Icons.settings,
          size: 40,
          color: Color.fromARGB(255, 30, 233, 169),
        ),
        SizedBox(height: 20),
        Icon(
          Icons.search_rounded,
          size: 40,
          color: Color.fromARGB(255, 128, 30, 233),
        ),
        SizedBox(height: 20),
        Icon(Icons.person, size: 40, color: Color.fromARGB(255, 7, 95, 162)),
        SizedBox(height: 20),
        Icon(
          Icons.category,
          size: 40,
          color: Color.fromARGB(255, 233, 142, 30),
        ),
        SizedBox(height: 20),
        Icon(Icons.shop, size: 40, color: Color.fromARGB(255, 6, 201, 13)),
        SizedBox(height: 20),
        Text('自定义图标,需要在pubspec.yaml中添加fonts文件'),
        Icon(Myfonts.book, size: 40, color: Color.fromARGB(255, 59, 33, 42)),
        SizedBox(height: 20),
        Icon(Myfonts.zhifbao, size: 40, color: Color.fromARGB(255, 59, 33, 42)),
        SizedBox(height: 20),
        Icon(Myfonts.shopcar, size: 40, color: Color.fromARGB(255, 59, 33, 42)),
        SizedBox(height: 20),
        Text('再次增加自定义图标,需要在pubspec.yaml中添加fonts文件'),
        Icon(Myfonts.pingg, size: 40, color: Color.fromARGB(255, 59, 33, 42)),
        Icon(Myfonts.shanzi, size: 40, color: Color.fromARGB(255, 227, 27, 97)),
      ],
    );
  }
}
